unit FormCardAuthority;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls;

type
  TfrmCardAuthority = class(TForm)
    Panel1: TPanel;
    procedure FormKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    strInput : string;
    { Public declarations }
  end;

var
  frmCardAuthority: TfrmCardAuthority;

implementation

{$R *.dfm}
function IsDigit(ch: char):boolean ;
begin
 Result := ch in ['0'..'9'];
end;

procedure TfrmCardAuthority.FormKeyPress(Sender: TObject; var Key: Char);
begin
    if Key = #27 then
    begin
        strInput := '';
        Close;
    end;

    if isDigit(Key) then strInput :=  strInput + Key;;
    if(Key = #13) then  Close;
end;

end.

